/**************************************************************************
**
** Copyright (C) 2011 Frank Büttner <frank-buettner@gmx.net>
**
** This program is free software: you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation, either version 3 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program.  If not, see <http://www.gnu.org/licenses/>.
**
**************************************************************************/


#include "Infoformular.h"
#include "Global.h"
#include "Modulliste.h"
#include "Modulbasis.h"

Infoformular::Infoformular(QWidget *eltern,const Modulliste *module) : QDialog(eltern)
{
    setWindowFlags(windowFlags()^Qt::WindowContextHelpButtonHint);
    setupUi(this);
    Programmname->setText(QString(Programmname->text()).replace("Programmname",ANWENUNGSNAME));
    Version->append(tr("Hauptprogramm: %1").arg(VERSIONTEXT));
    for(uint Modul=0;Modul<=module->AnzahlDerModule();Modul++)
    {
	if(module->Modul(Modul))
	    Version->append(tr("Modul: %1 Version: %2").arg(module->Modul(Modul)->Modulname()).arg(module->Modul(Modul)->Modulversion()));
    }
}

void Infoformular::changeEvent(QEvent *e)
{
    QDialog::changeEvent(e);
    switch (e->type())
    {
	case QEvent::LanguageChange:
				    retranslateUi(this);
				    break;
	default:
				    break;
    }
}
